﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register TagPrefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SearchNewsUserControl.ascx.cs"
    Inherits="JM.JCY.SharePointComponent.News.SearchNews.SearchNewsUserControl" %>

    <script type="text/javascript">

        function RedirectToViewNews(sender, newsId) {
            sender.href = "ViewNewsDetail.aspx?NewsId=" + newsId + "&Category=" + $("#<%=hfCategory.ClientID %>").val();
            return false;
        }

 
        function RedirectToManageNews(sender) {
            sender.href = "ManageNews.aspx?Category=" + $("#<%=hfCategory.ClientID %>").val();
        }


    </script>
   
<style type="text/css">
    .ms-input /* Set textbox's width of dtEffDateFrom and dtEffDateTo */
    {
        width: 75px;
    }
    
    table.form td.nopaddingleft
    {
        padding-left: 0px;
        padding-top: 0px;
        vertical-align: top;
        font-family: Calibri;
        font-size: 12px;
    }
</style>
<div>
    <table class="main">
        <tr>
       <td valign="top" width="100%" runat="server" id="tdContent">
                <table class="content" width="98%">
                    <tr>
                        <td style="padding: 5px;">
                            <table width="100%" class="title">
                                <tr>
                                    <td width="60%">
                                        <h2><img src="/_layouts/JM.JCY.Resource/images/新闻大.png" width="32" />
                                            <asp:Label ID="lblDisplay" runat="server"></asp:Label>
                                        </h2>
                                    </td>
                                        <td align="right">
 <img src="/_layouts/JM.JCY.Resource/images/plus.png" width="12"/>
                                     <asp:LinkButton ID="lkbCreateNews" runat="server" OnClientClick="RedirectToManageNews(this)"></asp:LinkButton>
                                    </td>
                                </tr>
                            </table>
                            <br />
                            <hr />
                            <table width="100%" class="form">
                                <tr>
                                    <td>
                                        标题
                                    </td>
                                    <td>
                                        :
                                    </td>
                                    <td>
                                        <asp:textbox id="txtSubject" runat="server" Width="480"></asp:textbox>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        发布时间
                                    </td>
                                    <td>
                                        :
                                    </td>
                                    <td class="nopaddingleft">
                                        <table cellpadding="0" cellspacing="0">
                                            <tr>
                                                <td align="left" valign="top" class="nopaddingleft">
                                                    <sharepoint:datetimecontrol id="dtEffDateFrom" calendarimageurl="/_layouts/JM.JCY.Resource/images/calendar.jpg"
                                                        datepickerframeurl="/_layouts/iframe.aspx" dateonly="true" calendar="Gregorian"
                                                        localeid="2052" runat="server"></sharepoint:datetimecontrol>
                                                </td>
                                                <td>
                                                    -
                                                </td>
                                                <td align="left" valign="top" class="nopaddingleft">
                                                    <sharepoint:datetimecontrol id="dtEffDateTo" calendarimageurl="/_layouts/JM.JCY.Resource/images/calendar.jpg"
                                                        datepickerframeurl="/_layouts/iframe.aspx" dateonly="true" calendar="Gregorian"
                                                        localeid="2052" runat="server"></sharepoint:datetimecontrol>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="3" class="button">
                                        <asp:imagebutton id="imgSubmit" runat="server" 
                                            imageurl="~/_layouts/JM.JCY.Resource/images/search.png" 
                                            onclick="imgSubmit_Click" />
                                        <asp:imagebutton id="imgCancel" runat="server" 
                                            imageurl="~/_layouts/JM.JCY.Resource/images/cancel.png" 
                                            onclick="imgCancel_Click"/>
                                    </td>
                                </tr>
                            </table>
                            <table width="100%" class="list">
                                <tr>
                                    <td>
                                        <div id="content">
                                            <asp:gridview id="gvBC" runat="server" autogeneratecolumns="False" borderwidth="0px"
                                                gridlines="Horizontal" cssclass="altrowstablebc" 
                                                OnRowDataBound="gvBC_DataBound" Width="100%" EnableModelValidation="True">
                                                <Columns>
                                                    <asp:TemplateField HeaderText="发布日期" ItemStyle-Width="15%">
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblEffDate" runat="server" Text='<%# Eval("CREATED_TIME") %>'></asp:Label>
                                                        </ItemTemplate>
                                                            <ItemStyle Width="15%"></ItemStyle>
                                                    </asp:TemplateField> 
                                                    <asp:TemplateField HeaderText="照片" ItemStyle-Width="25%">
                                                        <ItemTemplate>
                                                           <asp:Image ID="imgPic" runat="server" ImageUrl='<%# Eval("ImageUrl") %>' Width="144" Height="90" />
                                                        </ItemTemplate>
                                                            <ItemStyle Width="25%"></ItemStyle>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="主题" ItemStyle-Width="25%">
                                                    <ItemTemplate>
                                                            <asp:LinkButton ID="lbSubject" runat="server" Text='<%#Eval("Subject")%>' OnClientClick='<%# String.Format("RedirectToViewNews({0},{1})","this",Eval("ID")) %>'></asp:LinkButton>
                                                        </ItemTemplate>
                                                            <ItemStyle Width="25%"></ItemStyle>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="内容">    
                                                        <ItemTemplate> 
                                                            <asp:Label ID="lblContent" runat="server" Text='<%#Eval("Summary")%>'></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    
                                                </Columns>
                                            </asp:gridview>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                            <br />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</div>
<asp:HiddenField ID="hfCategory" runat="server" />
